package com.wrk._1_语法._03_分支;

import java.util.Scanner;

public class _003_根据输入的x值输出y2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入x值:");
        //等待输入
        int y;
        int x = scanner.nextInt();
        //判断
        if (x < 1) {
            y = x;
        } else if (1 <= x && x < 10) {
            y = 2 * x - 1;
        } else {
            y = 3 * x - 11;
        }
        System.out.println("y=" + y);
        scanner.close();
    }
}
